import $axios from './index.js'

// 栏目列表
function columnList(data) {
  const url = '/category/index'
  return $axios.get(url, data)
}
// 栏目详情
function columnInfo(data) {
  const url = '/category/read'
  return $axios.get(url, data)
}
// 栏目添加
function columnSave(data) {
  const url = '/category/save'
  return $axios.post(url, data)
}
// 栏目编辑
function columnUpdate(data) {
  const url = '/category/update'
  return $axios.post(url, data)
}
// 栏目删除
function columnDelete(data) {
  const url = '/category/delete'
  return $axios.post(url, data)
}

// 栏目内容列表
function contentList(data) {
  const url = '/content/index'
  return $axios.get(url, data)
}
// 栏目内容详情
function contentInfo(data) {
  const url = '/content/read'
  return $axios.get(url, data)
}
// 栏目内容添加
function contentSave(data) {
  const url = '/content/save'
  return $axios.post(url, data)
}
// 栏目内容编辑
function contentUpdate(data) {
  const url = '/content/update'
  return $axios.post(url, data)
}
// 栏目内容删除
function contentDelete(data) {
  const url = '/content/delete'
  return $axios.post(url, data)
}
// 栏目内容字段
function contentCreate(data) {
  const url = '/content/create'
  return $axios.get(url, data)
}
// 栏目副表内容
function mainContent(data) {
  const url = '/content/mainContent'
  return $axios.get(url, data)
}
// 是否置顶
function topOpt(data) {
  const url = '/content/topOpt'
  return $axios.post(url, data)
}
// 是否推荐--状态
function recommendAndStatus(data) {
  const url = '/content/recommendAndStatus'
  return $axios.post(url, data)
}
// 插入为内链
function addInnerChat(data) {
  const url = '/content/addInnerChat'
  return $axios.post(url, data)
}
// 批量导入
function articleUpload(data) {
  const url = '/content/articleUpload'
  return $axios.post(url, data)
}
// 图片本地化
function imgLocal(data) {
  const url = '/content/imgLocal'
  return $axios.post(url, data)
}
// 文章简介提取
function descExtraction(data) {
  const url = '/content/descExtraction'
  return $axios.post(url, data)
}

// 违禁词查询
function wordSearch(data) {
  const url = '/content/wordSearch'
  return $axios.post(url, data)
}

function copyColumn(data) {
  const url = '/category/copy'
  const timeout = 60000
  return $axios.post(url, data, timeout)
}

// 修改内容状态
function changeContentStatus(data) {
  return $axios.post('/content/editStatus', data)
}

// 审核内容
function checkContent(data) {
  return $axios.post('/content/checkAll', data)
}

// 删除内容
function deleteContent(data) {
  return $axios.post('/content/delAll', data)
}

// 恢复内容
function recoverContent(data) {
  return $axios.post('/content/recoverAll', data)
}

function getCheckList(data) {
  return $axios.get('/content/checkList', data)
}

export default {
  columnList,
  columnSave,
  columnUpdate,
  columnDelete,
  columnInfo,
  contentList,
  contentSave,
  contentUpdate,
  contentDelete,
  contentInfo,
  contentCreate,
  mainContent,
  topOpt,
  recommendAndStatus,
  addInnerChat,
  articleUpload,
  imgLocal,
  descExtraction,
  wordSearch,
  copyColumn,
  changeContentStatus,
  checkContent,
  deleteContent,
  recoverContent,
  getCheckList
}
